package org.example.mapper;

import org.apache.ibatis.annotations.Param;
import org.example.pojo.Person;

import java.util.List;
import java.util.Map;

/**
 * ClassName: PersonMapper
 * Package: org.example.mybatis.mapper
 * Description:
 *
 * @Author wanghao
 * @Create 2024-06-28 10:33
 * @Version 1.0
 */
public interface PersonMapper {

    void addPerson();

    int addPerson2(Person person);
    void delPerson(Integer id);
    void updatePerson(Person person);
    Person getPerson(Integer id);
    List<Person> getPersonList();
    Person getPersonByPname(String pname);
    Person getPersonByPname2(String pname);

    List<Person> getPersonList2(String tableName);
    List<Person> getPersonList3(String tableName);

    void addPerson3(@Param("pname") String pname, @Param("address") String address);
    void addPerson4(String pname, String address);

    Person getPersonByPnameAndAddress(Map<String, String> maps);


    // 数据输出
    // 1. 返回简单数据类型
    int getPersonCount();
    // 2. 返回实体类对象
    Person getPersonById(Integer id);
    Person getPersonById2(Integer id);

    Person getPersonById3(Integer id);
}
